﻿/*
 * @autor: hectorea
 * @date: 03/08/12
 * @project: SquareRoot
 * @Reference:
 *  http://en.wikipedia.org/wiki/Prime_number
 * 
 */

using System;
using System.Text;

namespace PrimeNumbers
{
    class Program
    {
        static void Main(string[] args)
        {
            do
            {
                Console.Clear();

                StringBuilder sb = new StringBuilder();
                sb.Append("Please type an integer: ");
                Console.Write(sb.ToString());

                int number = int.Parse(Console.ReadLine());

                try
                {                  
                    number.PrimeNumbers();
                    Console.WriteLine();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                Console.WriteLine("Please type any key to continue testing or [X] to exit");

            } while (!Console.ReadLine().ToUpper().Equals("X"));
        }
    }
}
